package com.aabte.utils;

import com.aabte.model.InterfaceName;

import java.util.Locale;
import java.util.ResourceBundle;

public class ConfigFile {
    private static ResourceBundle bundle = ResourceBundle.getBundle("application", Locale.CHINA);

    public static String getUrl(InterfaceName name){

        String address = bundle.getString("test.url");

        String uri = "";
        String testUrl = null;

        switch (name) {
            case LOGIN: {
                uri = bundle.getString("login.uri");
                break;
            }
            case ADD_USER:{
                uri = bundle.getString("addUser.uri");
                break;
            }
            case GET_USER_INFO: {
                uri = bundle.getString("getUserInfo.uri");
                break;
            }
            case GET_USER_LIST:{
                uri = bundle.getString("getUserList.uri");
                break;
            }
            case UPDATE_USER_INFO:{
                uri = bundle.getString("updateUserInfo.uri");
                break;
            }
            default: {
                throw new RuntimeException("uri 不存在！");
            }
        }

        testUrl = address+uri;

        return testUrl;
    }



}
